package ua.common;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ConfManager {

	private static Properties properties;
	private static ConfManager instance;
	
	public static ConfManager getInstance() {
		if (instance == null) {
			instance = new ConfManager();
		}
		return instance;
	}
	
	public Properties getProperties() {
		if (properties == null) 
		{
			properties = new Properties();
			InputStream in = null;
			try 
			{
				in = getClass().getResourceAsStream("/conf.properties");
				properties.load(in);
				in.close();
			}
			catch (IOException e) 
			{
				e.printStackTrace();
			}
		}
		return properties;
	}
	
}
